import React from 'react';
import { Switch, Route } from 'react-router-dom';
import Loadable from '@loadable/component';

function BaseSwitch() {
  return (
    <Switch>
      <Route exact path='/routerLearn/one' component={Loadable(() => import('./page/One'))}></Route>
      <Route exact path='/routerLearn/two' component={Loadable(() => import('./page/Two'))}></Route>
      {/* 分组命名 动态传参 */}
      <Route path='/routerLearn/three:tName?' component={Loadable(() => import('./page/Three'))}></Route>
      {/* 动态匹配 */}
      <Route path={['/routerLearn/:id?', '/routerLearn']} component={Loadable(() => import('./page/DynamicRouter'))}></Route>
    </Switch>
  );
}

export default BaseSwitch;
